<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

<xsl:template match='nbsp' name='nbsp'>
<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>
</xsl:template>

<xsl:template match="myPolls">
	<xsl:variable name="howmany">
		<xsl:value-of select="count(row[(@answerid&gt;0)])"/>
	</xsl:variable>
	<table bgcolor="#EEEEEE" class="body" border="0" cellspacing="0" cellpadding="4">
	<tr><td colspan="3" align="center">
		<xsl:value-of select="row/@form"/>:
		<xsl:value-of select="row/@title"/>
		</td></tr>
	<tr bgcolor="#EEEEEE">
		<td colspan="3" align="center">
			Tipo:<xsl:value-of select="row/@type"/><br/>
			Anonimo:<xsl:value-of select="row/@anon"/>
		</td>
		</tr>
	<tr bgcolor="#EEEEEE" height="10px"><td colspan="7" align="center"><img src="/imgs/white_sp.gif" width="75%" height="1" vspace="3" hspace="0"/></td></tr>
	<tr bgcolor="#EEEEEE">
		<td colspan="3" align="center">
			<b><xsl:value-of select="row/@question"/></b>
		</td>
		</tr>
	<xsl:for-each select="row[(@answerid&gt;0)]">
		<xsl:choose>
		<xsl:when test='/myPolls/@idtoedit=@answerid'>
			<tr bgcolor="#FFFFFF">
			<td colspan="3">
				<table class="body" border="0">
				<FORM name="salva" METHOD="POST" action="">
				<tr><td align="center">
				<INPUT TYPE="TEXT" SIZE="50" NAME="answer2change" value="{@answer}"></INPUT>				</td>
				<td align="center" valign="middle" onclick="javascrip:document.salva.submit()">
				<a href="/tests/iTestAddAnswers.aspx?pollid={@form}">Salva</a>
				<input type="hidden" name="pollid" value="{@form}"></input>
				<input type="hidden" name="answerid" value="{@answerid}"></input>
				</td>
				<td align="right" valign="middle">
				<a href="/tests/iTestAddAnswers.aspx?pollid={@form}">Annulla</a>
				</td>
				</tr>
				</FORM>
				</table>
			</td>
			</tr>
		</xsl:when>
		<xsl:otherwise>
			<tr bgcolor="#FFFFFF">
			<td><xsl:value-of select="@answer"/>
			</td>
			<td align="center"><!--<a href="/tests/iTestAddAnswers.aspx?pollid={@form}&amp;answerid={@answerid}&amp;edit=1"><img border="0" src="/imgs/modify.gif"/></a>-->
			</td>
			<td align="center"><a href="/tests/iTestAddAnswers.aspx?pollid={@form}&amp;answerid={@answerid}&amp;delete=1"><img border="0" src="/imgs/delete.gif"/></a>
			</td>
			</tr>
		</xsl:otherwise>
		</xsl:choose>
	</xsl:for-each>
	<xsl:if test="$howmany&lt;1">
		<tr bgcolor="#FFFFFF">
		<td colspan="3" align="center">
			Nessuna risposta e' stata ancora inserita in questo sondaggio!
		</td>
		</tr>
	</xsl:if>
	<tr bgcolor="#EEEEEE" height="10px"><td colspan="7" align="center"><img src="/imgs/white_sp.gif" width="75%" height="1" vspace="3" hspace="0"/></td></tr>
	<xsl:if test="not(row/@type=919 and $howmany&gt;3)">
	<tr>
		<td colspan="3" align="center">
			<table class="body" border="0">
			<FORM METHOD="POST" action="">
			<tr><td align="center">
			<INPUT TYPE="TEXT" SIZE="50" maxlength="100" NAME="answer2add"></INPUT><br/>
			<font class="body_10px_red">Inserisci la nuova risposta da aggiungere all'elenco di quelle possibili.</font>
			</td>
			<td align="center" valign="middle">
			<input type="submit" name="submit" value="Aggiungi"></input>
			<input type="hidden" name="pollid" value="{row/@form}"></input>
			</td></tr>
			</FORM>
			</table>
		</td>
		</tr>
	</xsl:if>
	</table>
</xsl:template>

</xsl:stylesheet>